# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=xfce4-screensaver
pkgver=4.16.0
pkgrel=1
pkgdesc="Screensaver and locker for XFCE"
url="https://git.xfce.org/apps/xfce4-screensaver/about/"
arch="all"
license="GPL-2.0-or-later"
makedepends="libx11-dev gtk+3.0-dev dbus-glib-dev glib-dev libxklavier-dev
	xfconf-dev garcon-dev libxrandr-dev libxscrnsaver-dev libxfce4ui-dev
	libxext-dev libwnck3-dev"
subpackages="$pkgname-doc $pkgname-lang"
source="https://archive.xfce.org/src/apps/xfce4-screensaver/${pkgver%.*}/xfce4-screensaver-$pkgver.tar.bz2
	xfce4-screensaver-chkpwd.c
	"
options="suid"
_libexecdir=/usr/lib/xfce4
build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--libexecdir=$_libexecdir \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-passwd-helper=$_libexecdir/xfce4-screensaver-chkpwd \
		--enable-locking
	make
	gcc $CFLAGS -Wall -o xfce4-screensaver-chkpwd "$srcdir"/xfce4-screensaver-chkpwd.c
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	install -g shadow -m 2755 xfce4-screensaver-chkpwd "$pkgdir"$_libexecdir/xfce4-screensaver-chkpwd
}

sha512sums="
5fa0381395b48fdfb5bdd9b4cafe1ec625d0b7fb9600d59c22c42fe0248fb4b99dd18a94045df3ecdc77635f7271676329c658f25003a9d8d6f9a9a66739dbe9  xfce4-screensaver-4.16.0.tar.bz2
795139f3d206b6bfd7fda580c59d0571db006c98f96b8cb51b60be9f0a36ea18ff5b941c15df99c1059fca3b8e6dd64962bd521ad87310ab6c430972ca35f9e9  xfce4-screensaver-chkpwd.c
"
